<#-- 导入模版定义文件-->
<#include "../template/template_editPage.ftl">
<#include "../template/include/source.ftl">
<@edit title="冲正and调正">
<body class="input">
<script type="text/javascript">
    function eto(id) {
        var b1 = $("#buyer" + id).val();
        var b2 = $("#price" + id).val();
        $("#buyer").html(b1);
        $("#buyers").val(b1);
        $("#ordersId").val($("#id" + id).val());
        $("#price").html(b2);
        $("#adjust").show();
    }
    $().ready(function () {
		<#if actionErrors??&&(actionErrors?size > 0)>
			$.dialog({type: "warn", content: "<#list errorMessages as list>${list}<br></#list>",
			 modal: true, autoCloseTime: 3000});
		</#if>
    });
</script>
<div style="width: 800px; height: 600px; border: solid 2px blue;">
    <div class="inputBar">
        <h1><span class="icon">&nbsp;</span>冲正/调账</h1>
    </div>
    <div style="display: none;" id="validateErrorContainer" class="validateErrorContainer">
        <div class="validateErrorTitle">以下信息填写有误,请重新填写</div>
        <ul></ul>
    </div>
    <br/><br/><br/>

    <div style="position: relative;left:0px;">
        <form method="post" action="${web_base}/recharge/adjustment!findOrder.htm">
            手机号或订单号 <input type="text" class="formText" name="order.buyer" value=""/>
            &nbsp;&nbsp; <input type="submit" class="formButton" value="提交"/>
        </form>
    </div>
    <br/><br/><br/><br/>

    <div style="position: relative;left:0px;">
        <table class="listTable" width="35%">
            <tr>
                <td>订单号</td>
                <td>手机号</td>
                <td>金 额</td>
                <td>时 间</td>
                <td>操 作</td>
            </tr>
            <#if list??>
                <#list list as or>
                    <form id="validateForm" class="validate" method="post"
                          action="${web_base}/recharge/adjustment!eto.htm">
                        <tr>
                            <td><input id="id${or_index}" type="text" readonly="true" class="in" name="adj.ordersId" value="${(or.id)!}"/>
                            </td>
                            <td><input id="buyer${or_index}" type="text" readonly="true" class="in"
                                       name="adj.fromMobile"
                                       value="${(or.buyer)!}"/></td>
                            <td><input id="price${or_index}" type="text" readonly="true" class="in" name=""
                                       value="${money(or.price)}"/></td>
                            <td><input id="" type="text" readonly="readonly" class="in" name=""
                                       value="<#if or.createTime?exists&&or.createTime?is_date>${(or.createTime?string("yyyy-MM-dd HH:mm:ss"))}</#if>"/>
                            </td>
                            <td><#if or.enableReverse??&&or.enableReverse>  <input type="submit" class="formButton" value="冲正"/></#if></td>
                            <td><#if or.enableAdjustment??&&or.enableAdjustment><input type="button" class="formButton" onclick="eto('${or_index}');" value="调账"/></#if></td>
                        </tr>
                    </form>
                </#list>
            </#if>
        </table>
    </div>
    <br/><br/><br/><br/>

    <form method="post" action="${web_base}/recharge/adjustment!adjust.htm">
     <br/>

        <div id="adjust" style="display:none">
            原 手 机 号：<span id="buyer" class="formText" name="adj.fromMobile" ></span>
            <input id="buyers" type="hidden" name="adj.fromMobile"/>
            <input id="ordersId" type="hidden" name="adj.ordersId"/>
            金 额：<span id="price"   class="formText" name="adj.ordersId" ></span>
        </div>
        <div>
            <br/>
            调至手机号：
            <input type="text" class="formText" name="adj.toMobile"/>
            <input type="submit" class="formButton" value="提交"/>
        </div>
    </form>
</div>
</body>

</@edit>